package com.ruoyi.ss.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ss.mapper.ActivityGroupMapper;
import com.ruoyi.ss.domain.ActivityGroup;
import com.ruoyi.ss.service.IActivityGroupService;

/**
 * 活动组Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-04
 */
@Service
public class ActivityGroupServiceImpl implements IActivityGroupService 
{
    @Autowired
    private ActivityGroupMapper activityGroupMapper;

    /**
     * 查询活动组
     * 
     * @param activityGroupId 活动组主键
     * @return 活动组
     */
    @Override
    public ActivityGroup selectActivityGroupByActivityGroupId(Long activityGroupId)
    {
        return activityGroupMapper.selectActivityGroupByActivityGroupId(activityGroupId);
    }

    /**
     * 查询活动组列表
     * 
     * @param activityGroup 活动组
     * @return 活动组
     */
    @Override
    public List<ActivityGroup> selectActivityGroupList(ActivityGroup activityGroup)
    {
        return activityGroupMapper.selectActivityGroupList(activityGroup);
    }

    /**
     * 新增活动组
     * 
     * @param activityGroup 活动组
     * @return 结果
     */
    @Override
    public int insertActivityGroup(ActivityGroup activityGroup)
    {
        activityGroup.setCreateTime(DateUtils.getNowDate());
        return activityGroupMapper.insertActivityGroup(activityGroup);
    }

    /**
     * 修改活动组
     * 
     * @param activityGroup 活动组
     * @return 结果
     */
    @Override
    public int updateActivityGroup(ActivityGroup activityGroup)
    {
        activityGroup.setUpdateTime(DateUtils.getNowDate());
        return activityGroupMapper.updateActivityGroup(activityGroup);
    }

    /**
     * 批量删除活动组
     * 
     * @param activityGroupIds 需要删除的活动组主键
     * @return 结果
     */
    @Override
    public int deleteActivityGroupByActivityGroupIds(Long[] activityGroupIds)
    {
        return activityGroupMapper.deleteActivityGroupByActivityGroupIds(activityGroupIds);
    }

    /**
     * 删除活动组信息
     * 
     * @param activityGroupId 活动组主键
     * @return 结果
     */
    @Override
    public int deleteActivityGroupByActivityGroupId(Long activityGroupId)
    {
        return activityGroupMapper.deleteActivityGroupByActivityGroupId(activityGroupId);
    }
}
